package com.xiaoshu.service.feign;

import com.xiaoshu.config.FeignConfig;
import com.xiaoshu.model.ResultVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;

/**
 * 功能说明：通过Feign方式调用文件上传服务
 *
 * @ com.xiaoshu.service.feign
 * <p>
 * Original @Author: deane.jia-贾亮亮,@2020/10/28@10:19
 * <p>
 * Copyright (C)2012-@2020 深圳小树盛凯科技 All rights reserved.
 */
@FeignClient(name = "xiaoshu-dubbo-spring-cloud-provider", configuration = FeignConfig.class)
public interface FileFeignImpl {

    /**
     * function: provide file upload , by Feign ;
     *
     * @param file
     * @return
     */
    @PostMapping(value = "/produce/file/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    ResultVo<?> uploadFileService(@RequestPart("file") MultipartFile file);
}
